---
id: 660f4e74f7fd3f4a99ac2e50
title: Step 99
challengeType: 1
dashedName: step-99
---

# --description--

Notice that like `.push()`, `.unshift()` returns the new length of the array after the element is added.

Arrays also have a `.shift()` method. This will remove the **first** element of the array, unlike `.pop()` which removes the last element. Here is an example of the `.shift()` method:

```js
const numbers = [1, 2, 3];
numbers.shift();
```

The `numbers` array would be `[2, 3]`.

Declare a `shifted` variable, assign it the result of calling `.shift()` on your `numbers` array, and print the variable.

# --hints--

You should use `const` to declare a `shifted` variable.

```js
assert.match(code, /const\s+shifted/);
```

You should call `.shift()` on your `numbers` array.

```js
assert.deepEqual(numbers, [5, 2, 3]);
```

You should assign the result of your `.shift()` call to your `shifted` variable.

```js
assert.equal(shifted, 1);
```

You should log your `shifted` variable.

```js
assert.match(code, /console\.log\(\s*shifted\s*\)/);
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
  rows.push(padRow(i, count));
}*/

/*while (rows.length < count) {
  rows.push(padRow(rows.length + 1, count));
}*/

/*for (let i = count; i > 0; i--) {
  rows.push(padRow(i, count));
}*/

--fcc-editable-region--
const numbers = [1, 2, 3];


const unshifted = numbers.unshift(5);
console.log(unshifted);
console.log(numbers);
--fcc-editable-region--

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
